<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: E:/work/wheels/C++/include/funcTraits.hpp</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="doc-content">
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">E:/work/wheels/C++/include/funcTraits.hpp</div></div>
</div><!--header-->
<div class="contents">
<p>获取参数类型</p>
<p>获取参数类型 </p><dl class="tparams"><dt>模板参数</dt><dd>
  <table class="tparams">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>
<p>using p1type = typename argType&lt; 1 &gt;::type;</p>
<div class="fragment"><div class="line"> </div>
<div class="line"><span class="preprocessor">#pragma once</span></div>
<div class="line"><span class="preprocessor">#include &lt;type_traits&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/d8d/namespacewheels.html">wheels</a></div>
<div class="line">{</div>
<div class="line">    </div>
<div class="line">    <span class="keyword">namespace </span>__private{</div>
<div class="line"> </div>
<div class="line">        <span class="keyword">template</span>&lt; <span class="keywordtype">size_t</span> IDX , <span class="keyword">typename</span> Args1 , <span class="keyword">typename</span> ...pArgs &gt;</div>
<div class="line">        <span class="keyword">struct </span>__arg_type: <span class="keyword">public</span> __arg_type&lt; IDX - 1 , pArgs... &gt;{</div>
<div class="line">            <span class="keyword">using </span><a id="a0" name="a0"></a><a class="code hl_typedef" href="../../d5/dc4/structwheels_1_1____private_1_1____arg__type.html#a180459c1e9ee6de657feb223e885b5a5">type</a> = <span class="keyword">typename</span> __arg_type&lt; IDX - 1 , pArgs... &gt;<a class="code hl_typedef" href="../../d5/dc4/structwheels_1_1____private_1_1____arg__type.html#a180459c1e9ee6de657feb223e885b5a5">::type</a>;</div>
<div class="line">        };</div>
<div class="line">        </div>
<div class="line">        <span class="keyword">template</span>&lt; <span class="keyword">typename</span> Arg1 , <span class="keyword">typename</span> ...pArgs &gt;</div>
<div class="line">        <span class="keyword">struct </span>__arg_type&lt;0, Arg1 , pArgs...&gt;{</div>
<div class="line">            <span class="keyword">using </span><a class="code hl_typedef" href="../../d5/dc4/structwheels_1_1____private_1_1____arg__type.html#a180459c1e9ee6de657feb223e885b5a5">type</a> = Arg1;</div>
<div class="line">        };</div>
<div class="line">        </div>
<div class="line"> </div>
<div class="line">        <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T &gt; <span class="keyword">struct </span>__imp_func_traitor{};</div>
<div class="line">        <span class="keyword">template</span>&lt; <span class="keyword">typename</span> retType , <span class="keyword">typename</span> ...Args &gt;</div>
<div class="line">        <span class="keyword">struct </span>__imp_func_traitor&lt;<a class="code hl_namespace" href="../../d8/dcc/namespacestd.html">std</a>::function&lt; retType ( Args... )&gt; &gt;{</div>
<div class="line">            <span class="keyword">template</span>&lt; <span class="keywordtype">size_t</span> N &gt;</div>
<div class="line">            <span class="keyword">struct </span>argType{</div>
<div class="line">                <span class="keyword">static_assert</span>( N &lt; <span class="keyword">sizeof</span>...(Args)  , <span class="stringliteral">&quot;&quot;</span> );                 </div>
<div class="line">                <span class="keyword">using </span>type = <span class="keyword">typename</span> __arg_type&lt; N , Args... &gt;::type;</div>
<div class="line">            };</div>
<div class="line">            </div>
<div class="line">            <span class="keyword">using </span>ret_type = retType;</div>
<div class="line">        };</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keyword">template</span>&lt; <span class="keyword">typename</span> typeFunctor &gt; <span class="keyword">struct </span>funcTraitor{};</div>
<div class="line"> </div>
<div class="line">    <span class="keyword">template</span>&lt; <span class="keyword">typename</span> retType , <span class="keyword">typename</span> ...Args &gt;</div>
<div class="line">    <span class="keyword">struct </span>funcTraitor&lt; retType(Args...) &gt;: <span class="keyword">public</span> __private::__imp_func_traitor&lt; std::function&lt; retType (Args...) &gt; &gt; {};</div>
<div class="line"> </div>
<div class="line">    <span class="keyword">template</span>&lt; <span class="keyword">typename</span> <span class="keyword">class</span>Type , <span class="keyword">typename</span> funcType &gt;</div>
<div class="line">    <span class="keyword">struct </span>funcTraitor&lt; funcType classType::*&gt; : <span class="keyword">public</span> __private::__imp_func_traitor&lt; std::function&lt;funcType&gt; &gt; {};</div>
<div class="line">    <span class="comment">// 函数对象</span></div>
<div class="line">    <span class="keyword">template</span>&lt; <span class="keyword">typename</span> retType , <span class="keyword">typename</span> ...Args &gt;</div>
<div class="line">    <span class="keyword">struct </span>funcTraitor&lt; <a class="code hl_namespace" href="../../d8/dcc/namespacestd.html">std</a>::function&lt; retType(Args...) &gt; &gt; : <span class="keyword">public</span> __private::__imp_func_traitor&lt; std::function&lt; retType(Args...) &gt;&gt;{};</div>
<div class="line">}</div>
<div class="ttc" id="anamespacestd_html"><div class="ttname"><a href="../../d8/dcc/namespacestd.html">std</a></div><div class="ttdef"><b>定义</b> <a href="../../d1/d92/mandarava_2event_8hpp_source.html#l00038">event.hpp:39</a></div></div>
<div class="ttc" id="anamespacewheels_html"><div class="ttname"><a href="../../df/d8d/namespacewheels.html">wheels</a></div><div class="ttdoc">堆栈信息读取和保存记录</div><div class="ttdef"><b>定义</b> <a href="../../d3/df7/ary__str_8hpp_source.html#l00006">ary_str.hpp:7</a></div></div>
<div class="ttc" id="astructwheels_1_1____private_1_1____arg__type_html_a180459c1e9ee6de657feb223e885b5a5"><div class="ttname"><a href="../../d5/dc4/structwheels_1_1____private_1_1____arg__type.html#a180459c1e9ee6de657feb223e885b5a5">wheels::__private::__arg_type::type</a></div><div class="ttdeci">typename __arg_type&lt; IDX - 1, pArgs... &gt;::type type</div><div class="ttdef"><b>定义</b> <a href="../../d4/d67/func_traits_8hpp_source.html#l00022">funcTraits.hpp:22</a></div></div>
</div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
